﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Admin/Masters/Admin.master" CodeBehind="MasterPages.aspx.vb" Inherits="Boogaloo.Admin.UI.Webpages.MasterPages" 
    title="Mindfly Web Studio's Boogaloo - Host - MasterPages" %>
<%@ register tagprefix="boogaloo" assembly="Boogaloo.Admin" namespace="Boogaloo.Admin.UI.Controls" %>     
<script runat="server">
    '
    ' Boogaloo® - http://www.mindfly.com
    ' Copyright (c) 2008
    ' by Mindfly, Inc.
    '
    ' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
    ' documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
    ' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
    ' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    '
    ' The above copyright notice and this permission notice shall be included in all copies or substantial portions 
    ' of the Software.
    '
    ' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
    ' INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    ' DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    ' SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    ' SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    ' WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    ' THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
</script>
<asp:content id="MainConent" contentplaceholderid="MainContent" runat="server">


        <h3>Website Master Pages</h3>
        
        
        
        <div>
            <div class="box revealControl">
                <h4>Master Pages</h4>
                <span class="buttonWrap">
			        <button type="button" class="button reveal add">+</button>
			        <span>Add another Master Page</span>
		        </span>
		        
		          </div>
		        <div class="reveal panel">
		        
		    
                    <asp:updatepanel id="upio" runat="server">
                    <contenttemplate>
                    
                    
                    
                    <h4><asp:label id="lbl_ddl_dir" associatedcontrolid="ddl_dir" runat="server">Step 1. Choose the directory with the desired master pages:</asp:label></h4>
                    <asp:dropdownlist id="ddl_dir" runat="server" autopostback="true" causesvalidation="false" /> 
                    <asp:linkbutton id="lb_showsubdir" commandargument="subdir" runat="server" text="Add a sub directory" causesvalidation="false" />
                    <asp:linkbutton id="lb_showaddmaster" commandargument="addmaster" runat="server" text="Add a MasterPage to this directory" causesvalidation="false" />
                    <asp:hyperlink id="hyp_cancelshow" runat="server" text="Cancel" />
                    
                    <boogaloo:commitwizard id="dwiz_dir" runat="server" start_text="Delete this directory" message="<p>You are about to delete this directory.</p><p>This action cannot be reversed. Please verify you wish to continue.</p>" commit_text="Yes, please delete this directory" cancel_text="I do not want to delete this directory" validationgroup="deletedir" />
                    <asp:label id="lbl_nodeletedir" runat="server"><em>This directory cannot be deleted because it contains files or other directories</em></asp:label>
                    
                   
                    
                    <asp:panel id="pnl_subdir" runat="server">
                    
                    <div class="box enriched">
                        <h4>Add a sub directory</h4>
                        <asp:label id="lbl_txt_subdir" runat="server" associatedcontrolid="txt_subdir">
                        Enter the new directory's name <asp:textbox id="txt_subdir" runat="server" /> 
                        </asp:label>
                        <boogaloo:commitwizard id="cwiz_createdirectory" runat="server" commandargument="subdir" start_text="Create directory" message="<p>Once a directory is created, it's name cannot be editted. <strong>Please consider that any special characters and spaces will be <em>removed</em> as Studio Boogaloo creates the directory.</strong></p><p>With this in mind, please double check your spelling prior to proceeding.</p>" commit_text="Yep, it all checks out.  Create the directory" cancel_text="Thanks for warning me, I need to make a change!" causesvalidation="true" validationgroup="subdir" />
                        <asp:requiredfieldvalidator runat="server" id="rfv_txt_subdir" 
                        controltovalidate="txt_subdir" errormessage="The directory name is required." display="Dynamic" validationgroup="subdir" />                
                        <!-- AJAX CALL HERE TO VERIFY DIRECTORY NAME IS UNIQUE AS USER TYPES -->
                        <br />
                        <span class="hint"><em>Please remember directory names need to be unique with respect to their level in the directory tree</em></span>
                    </div>
                    </asp:panel>
                    
                    <asp:panel id="pnl_addmaster" runat="server">
                    <div class="box enriched">
                        <h4>Add a MasterPage to this directory</h4>
                        
                        <asp:label id="lbl_txt_newmasterpage" runat="server" associatedcontrolid="txt_newmasterpage">
                        Enter the new MasterPage's name <asp:textbox id="txt_newmasterpage" runat="server" />
                        </asp:label>
                        <boogaloo:commitwizard id="cwiz_newmasterpage" runat="server" validationgroup="addnewmaster" causesvalidation="true" commandargument="masterpage" start_text="Create the new MasterPage" message="<p>Once a MasterPage is created, it's name cannot be editted. <strong>Please consider that any special characters and spaces will be <em>removed</em> as Studio Boogaloo creates the directory.</strong></p><p>With this in mind, please double check your spelling prior to proceeding.</p>" commit_text="Yep, it all checks out. Add the MasterPage" cancel_text="I need to start over" />
                        <asp:requiredfieldvalidator id="rfv_txt_newmasterpage"  controltovalidate="txt_newmasterpage" runat="server" validationgroup="addnewmaster" errormessage="The name of the MasterPage is required" display="Dynamic" />
                        <br />
                        <span class="hint"><em>Please remember MasterPage names need to be unique with respect to their level in the directory tree and it often helps to give them names that coincide with their functional usage.</em></span>
                    </div>
                    </asp:panel>
                    
                    
                    
                    </contenttemplate>        
                    </asp:updatepanel>
                    
                    
                    
                    <asp:updatepanel id="up" runat="server">
                    <contenttemplate>
                    
                    <fieldset>        
                    <h4>Step 2: Create an alias for a master page (if desired) then associate it with this website:</h4>
                    
                    <asp:repeater id="rpt_files" runat="server">
                        <headertemplate>
                        <ul class="list masterPageAlias">
                        <li class="listHead">
                            <span>Master page</span>
                            <span>Alias</span>
                            
                        </li>
                        </headertemplate>
                        <itemtemplate>
                        <li>
                            <span class="masterPageName"><asp:literal id="lit_filename" runat="server" /></span>              
                            <asp:textbox id="txt_alias" runat="server" />
                            <asp:linkbutton id="lb_associate" runat="server" text="Associate this MasterPage" onclick="lb_associate_Click" validationgroup="associatemaster" />
                            <asp:requiredfieldvalidator id="rfv_alias" controltovalidate="txt_alias" runat="server" display="Dynamic" errormessage=" A descriptive name is required for this master page so that it can be recognized in various selections throughout Boogaloo" validationgroup="associatemaster" />
                        </li>
                        </itemtemplate>
                        <footertemplate>
                        </ul>
                        </footertemplate>
                    </asp:repeater>
                    <asp:literal id="lit_nofiles" runat="server"><p>This directory does not have any master page files that can be associated.</p></asp:literal>
                    
                    </fieldset>
                    
                            
                    </contenttemplate>        
                    <triggers>
                        <asp:asyncpostbacktrigger controlid="ddl_dir" />
                    </triggers>
                    </asp:updatepanel>
        
        
              
	        </div>
        </div>
        
        
        
        <asp:updatepanel id="uplist" runat="server">
        <contenttemplate>
        
            <h4>Current Master Pages</h4>
            <asp:repeater id="rpt_mastertemplates" runat="server">
            <headertemplate><ul class="list associatedMasterPages"></headertemplate>
            
            <itemtemplate>
            <li>
                <boogaloo:labelhiddentextbox id="lht_alias" runat="server" validationgroup="changealias" CssClass="inlineEdit" label="Enter a name for your master page" validate="true" onclick="lht_alias_Click" errormessage="A descriptive name is required for this master page so that it can be recognized in various selections throughout Boogaloo" />
                
                <asp:hyperlink id="hyp_master_virtual_path" runat="server" tooltip="Click to edit this MasterPage" />
            <boogaloo:commitwizard id="dwiz" runat="server" commit_text="Yep, do it already" cancel_text="Woops! I did not mean to hit that button." start_text="Remove" message="<p>You are about to delete this masterpage.</p><p>This action cannot be reversed!</p>" onclick="dwiz_Click" />
            </li>
            </itemtemplate>
            
            <footertemplate></ul></footertemplate>
            </asp:repeater>
            <asp:literal id="lit_nomasterpages" runat="server">This host does not currently have master pages associated with it.</asp:literal>
        

        </contenttemplate>        
        </asp:updatepanel>
        


        
</asp:content>

<asp:content id="SubContent" contentplaceholderid="SubContent" runat="server">
    <boogaloo:htmlretriever id="htmlretriever" runat="server" html_for="masters_help" page_group="host" />
</asp:content>
